{php include wl_template('common/header');}
<ul class="nav nav-tabs">
    <li class="active"><a href="javascript:;">业务员管理</a></li>
</ul>
<div class="app-content">
    <div class="app-filter">
        <div class="filter-action">
            <a href="{php echo web_url('salesman/salesman/edit')}" class="btn btn-primary">添加业务员</a>
        </div>
        <div class="filter-list">
            <form class="form-horizontal" action="" method="get">
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="{MODULE_NAME}" />
                <input type="hidden" name="p" value="salesman" />
                <input type="hidden" name="ac" value="salesman" />
                <input type="hidden" name="do" value="lists" />
                <div class="form-group">
                    <div class="col-sm-2 control-label">业务员信息</div>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" name="name" value="{$_GPC['name']}" placeholder="请输入业务员姓名">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2 control-label"></div>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <button class="btn btn-primary" type="submit">搜索</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="app-table-list">
        <div id="list" class="panel tab-pane panel-default">
            <div class="table-responsive">
                <table class="table table-hover table-bordered">
                    <thead>
                        <tr>
                            <th class="text-center" style="width:5%">业务员ID</th>
                            <th class="text-center" style="width:20%">业务员信息</th>
                            <th class="text-center" style="width:15%">姓名/电话</th>
                            <th class="text-center" style="width:10%">提成比例</th>
                            <th class="text-center" style="width:20%">店铺信息</th>
                            <th class="text-center" style="width:10%">状态</th>
                            <th class="text-center" style="width:10%">创建时间</th>
                            <th class="text-center" style="width:10%">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        {loop $lists $k $v}
                        <tr class="text-center">
                            <td>
                                {$v['id']}
                            </td>
                            <td class="name text-left">
                                <div style="display: flex">
                                    <img class="img-40" src="{$v['member']['avatar']}" style="border-radius:50%;border:1px solid #efefef;" onerror="this.src='../addons/{MODULE_NAME}/web/resource/images/nopic-small.jpg'" height="40" width="40">
                                    <span style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left: 5px">
                                       <span class="nickname">{$v['member']['nickname']}</span>
                                    </span>
                                </div>
                            </td>
                            <td class="sort">
                                {$v['name']}<br>
                                {$v['mobile']}
                            </td>
                            <td class="sort">
                                {if $v['alone'] == 1}
                                {$v['scale']}%
                                {else}
                                {$settings['scale']}%
                                {/if}
                            </td>
                            <td class="sort">
                                <div style="display: flex">
                                    <img class="img-40" src="{php echo tomedia($v['store']['logo'])}" style="border-radius:50%;border:1px solid #efefef;" onerror="this.src='../addons/{MODULE_NAME}/web/resource/images/nopic-small.jpg'" height="40" width="40">
                                    <span style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left: 5px">
                                       <span class="nickname">{$v['store']['storename']}</span>
                                    </span>
                                </div>
                            </td>
                            <td>
                                <span class='label {if $v['enabled']==1}label-primary{else}label-default{/if}'>
                                {if $v['enabled']==1}启用{else}禁用{/if}</span>
                            </td>
                            <td>
                                {php echo date('Y-m-d H:i:s',$v['createtime'])}
                            </td>
                            <td>
                                <a class="btn btn-sm btn-primary" href="{php echo web_url('salesman/salesman/edit',array('id'=>$v['id']))}">编辑</a>
                                <a class="btn btn-sm btn-danger"  data-toggle="ajaxRemove" href="{php echo web_url('salesman/salesman/del',array('id'=>$v['id']))}" data-confirm="确定删除当前业务员?">删除</a>
                            </td>
                        </tr>
                        {/loop}
                    </tbody>
                </table>
            </div>
            <div class="app-table-foot clearfix">
                <div class="pull-left">
                </div>
                <div class="pull-right">
                    {$pager}
                </div>
            </div>
        </div>
    </div>
</div>
{php include wl_template('common/footer');}